import java.util.Scanner;

/**
 *  斐波那契序列
 */
public class FibonacciSequence {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[10000001];
        a[1] = 1;
        a[2] = 1;
        for (int i = 3 ; i <= n ; i++){
            a[i] = (a[i-1] + a[i-2])%10007;
        }
        System.out.println(a[n]);
    }
}
